/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * All Rights Researved.
 *
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 *
 * @author: jin Chen 
 * @date: Jun 17, 2003
 * @version: $VERSION$
 */
package edu.psu.geovista.app.pcp.plot.control;

import edu.psu.geovista.app.pcp.Pcp;
import edu.psu.geovista.app.pcp.plot.control.tools.BasicTool;
import edu.psu.geovista.app.pcp.plot.gui.BasicPcpUI;

import javax.swing.*;
import java.awt.*;
import java.util.Hashtable;

public class BasicConfig extends JPanel {
    public static final String AXIS_CONFIG="Axis Configuration";
    public static final String PLOT_CONFIG="Plot Configuration";
    public static final String DATA_CONFIG="Line Configuration";

    protected ConfigManager owner;
    protected Hashtable cmds;

    public BasicConfig(String name,  ConfigManager owner) {
        this.setName(name);
        this.owner =owner;

        this.setLayout(new BorderLayout());
        this.add(new JLabel(this.getName() ));
        this.setCmds(owner.getTargetUI().getToolsMgr().getCmds() );

        this.setPreferredSize(new Dimension(400,400));
    }

    public void setCmds(Hashtable cmds) {
        this.cmds = cmds;
    }
    public BasicTool getCmd(String name){
        return (BasicTool)this.cmds.get(name);
    }

    public BasicPcpUI getTargetUI() {
        return this.owner.getTargetUI() ;
    }
    public void updateView() {
    }
    public Pcp getPlot(){
       if(owner!=null)
       return owner.getTargetUI().getPlot() ;
       else return null;
    }


}
